{% extends "layout.html" %}
{% from "nunjucks/switch_tree.html" import tree_menu %}

{% block title %}{{ name }} - DXR{% endblock %}

{% block head %}
  <link rel="shortcut icon" href="{{ icon_url }}" />
{% endblock %}

{% block site_css %}
  {{ super() }}
  <link href="{{ url_for('.static', filename='css/tree-selector.css') }}" rel="stylesheet" type="text/css" media="screen" />
{% endblock %}

{% block content %}
  {% if sections %}
    <div class="panel">
      <button id="panel-toggle">
        <span class="navpanel-icon expanded" aria-hidden="false"></span>
        Navigation
      </button>
      <section id="panel-content" aria-expanded="true" aria-hidden="false">
        {% for section in sections %}
          <h4>{{ section.heading }}</h4>
          <ul>
            {% for item in section['items'] %}
              <li>
                <a href="{{ item.href }}" title="{{ item.title }}" class="{{ item.icon }} icon" {%- if 'template' in item %} data-template="{{ item.template }}" {%- endif %}>{{ item.title }}</a>
              </li>
            {%- endfor %}
          </ul>
        {% endfor %}
      </section>
    </div>
  {% endif %}
{% endblock %}

{% block site_js %}
  {{ super() }}
  <script src="{{ url_for('.static', filename='js/panel.js') }}"></script>
  <script src="{{ url_for('.static', filename='js/tree-selector.js') }}"></script>
  <script src="{{ url_for('.static', filename='js/code-highlighter.js') }}"></script>
{% endblock %}
